<template>
	<view class="detail">
		<text>{{options.title}}</text>
		<text>上报时间：{{options.ereportTime}}</text>
		<view class="text_box">
			<text>上报人：{{options.ereportUser}}</text>
			<view>
				<text>上报状态：</text>
				<text>已处理</text>
			</view>
		</view>
		<view class="content_box">
			<text>{{options.content}}</text>
		</view>
		<view class="image_box">
			<text>相关图片</text>
			<view v-if="options.fileUrl">
				<image @click="prewImage(item)" :src="fullImage(item)" mode="" v-for="(item,index) in options.fileUrl.split(',')" :key="index">
				</image>
			</view>
		</view>
		<view class="process_box">
			<view>
				<text>回复内容</text>
				<text>{{options.handledResult?options.handledResult:'无'}}</text>
			</view>
			<view>
				<text>回复图片</text>
				<view v-if="options.handledFile">
					<image @click="prewImage(item)" :src="fullImage(item)" mode="" v-for="(item,index) in options.handledFile.split(',')"
						:key="index"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		fullImage
	} from '@/utils/api.js'
	export default {
		data() {
			return {
				options: {}
			}
		},
		onLoad(option) {
			this.options = JSON.parse(decodeURIComponent(option.item))
		},
		methods: {
			fullImage,
			handleClick() {
				uni.navigateTo({
					url: '/pages/eventList/result',
				})
			},
			prewImage(item) {
				let url = fullImage(item);
				uni.previewImage({
					count: 0,
					urls: [url]
				});
			},
		},
	}
</script>

<style lang="less" scoped>
	.detail {
		width: 100%;
		padding: 28upx;

		>text {
			text-align: justify;
			margin-bottom: 28upx;
			display: block;

			&:nth-of-type(1) {
				font-size: 34upx;
				color: #333333;
				font-weight: 600;
			}

			&:nth-of-type(2) {
				font-size: 22upx;
				color: #999999;
			}
		}

		.text_box {
			width: 100%;
			display: flex;
			justify-content: space-between;
			font-size: 22upx;
			color: #999999;
			margin-bottom: 28upx;

			>view {
				>text {
					&:nth-of-type(2) {
						padding-left: 14upx;
						position: relative;

						&:before {
							content: '';
							width: 12upx;
							height: 12upx;
							position: absolute;
							left: -6upx;
							top: 50%;
							transform: translateY(-50%);
							background: #2BF882;
							border-radius: 50%;
						}
					}
				}
			}
		}

		.content_box {
			width: 100%;
			text-align: justify;
			padding: 28upx;
			margin-bottom: 28upx;
			background: #fff;
			border-radius: 18upx;

			>text {
				color: #333333;
				font-size: 28upx;
			}
		}

		.image_box {
			width: 100%;
			background: #fff;
			border-radius: 18upx;
			margin-bottom: 28upx;
			padding: 28upx;

			>text {
				font-size: 28upx;
				color: #333333;
				font-weight: 600;
			}

			>view {
				width: 100%;
				display: flex;
				flex-wrap: wrap;

				>image {
					flex-shrink: 0;
					width: 145upx;
					height: 145upx;
					border: 1upx solid #999;
					margin: 28upx 5upx 0;
					border-radius: 6upx;
				}
			}
		}

		.process_box {
			width: 100%;
			background: #fff;
			border-radius: 18upx;
			margin-bottom: 28upx;
			padding: 28upx;

			>view {
				margin-bottom: 28upx;

				&:nth-of-type(1) {
					>text {
						font-size: 28upx;
						color: #333333;
						display: block;

						&:nth-of-type(1) {
							font-weight: 600;
						}

						&:nth-of-type(2) {
							margin-top: 28upx;
						}
					}
				}

				&:nth-of-type(2) {
					>text {
						font-size: 28upx;
						color: #333333;
						font-weight: 600;
					}

					>view {
						width: 100%;
						display: flex;
						flex-wrap: wrap;

						>image {
							flex-shrink: 0;
							width: 145upx;
							height: 145upx;
							border: 1upx solid #999;
							margin: 28upx 5upx 0;
							border-radius: 6upx;
						}
					}
				}
			}
		}
	}
</style>